//点赞和取消
function likeAndCancel (articleId,type,likeNum,like) {
    if (like == 'true') {
        like = 'false';
        $('#likeBtn').removeClass('fa-thumbs-up').addClass('fa-thumbs-o-up').attr('style', "color: black");
        $('#likeBtn').html(--likeNum);
        $.ajax({
            type: "delete",
            url: baseUrl + '/users/cancelLike/' + articleId + '/' + type,//type: 1.游记;2.大攻略;3.日报;4.攻略文章
            success: function () {
                $(document).dialog({
                    type: 'notice',
                    infoText: '已取消',
                    autoClose: 1000,
                    position: 'center'  // center: 居中; bottom: 底部
                });
            }
        })
    } else {
        like = 'true';
        $('#likeBtn').removeClass('fa-thumbs-o-up').addClass('fa-thumbs-up').attr('style', "color: #00bbd3");
        $('#likeBtn').html(++likeNum);
        $.ajax({
            type: "post",
            url: baseUrl + '/users/like/' + articleId + '/' + type,//type: 1.游记;2.大攻略;3.日报;4.攻略文章
            // data: {
            //     travelId:travelId,
            //     type:1
            // },
            success: function () {
                $(document).dialog({
                    type: 'notice',
                    infoText: '谢谢点赞!',
                    autoClose: 1000,
                    position: 'center'  // center: 居中; bottom: 底部
                });
            }
        })
    }
}
